home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tcoop10a.zip
/
DOC.ZIP
/
PLAY.DOC
< prev
next >
Wrap
Text File
|
1991-11-20
|
4KB
|
104 lines
PLAY.DOC 11/15/91 Copyright (c) 1991 by James S. Clark
==========================================================================
PLAY
Play Class
--------------------------------------------------------------------------
Class Name Play
Superclass Sound
Category Sound
Other classes referenced <none>
Other catagories referenced <none>
Used by Effect
Inherited by <none>
Declaration Play *play
Instance Variables
int status;
int mode;
int tempo;
int octave;
Instance Methods
Play ();
~Play ();
void start ();
void stop ();
void string (char *);
--------------------------------------------------------------------------
GENERAL DESCRIPTION
The Play Class provides the capability for playing music through the PC's
built-in speaker, by entering characters string representations of the
music. The music is encoded using the same technique as in Microsoft
Basic or for ASCII music. A summary of the ANSII music commands that are
accepted by Play are listed in the appendix at the end of this document.
The Play Class is derived from the Sound Class and will automatically
initialize the sound system when an instance of Play is created. For the
reason, do NOT create more than one instance of the Play Class at any
given time.
--------------------------------------------------------------------------
VARIABLES
int status;
Current status of the play system. 0 = inactive, 1 = active
int mode;
Current mode of the play system. 0 = background, 1 = foreground
int tempo;
The current tempo in beats per minute. Range is 60 to 240. The
default is 120.
int octave;
The current octave. The range is 0 to 7. The default is 3.
--------------------------------------------------------------------------
METHODS
Play ();
Creates a new instance of the Play Class and initializes the
sound system.
~Play ();
Removes the sound system from memory and destroys the instance.
void start ();
Resumes playing the music if tones are available.
void stop ();
Stops playing the music. Play can resume by using start.
void string (char *);
Translates an ASCII play string into a series of tones, and sends
them to the sound system. Use this command to feed your music
into the player.
--------------------------------------------------------------------------
APPENDIX A:
LIST OF ANSI MUSIC COMMANDS
A-G Note values in the scale
#,+ makes a note sharp b,- makes a note flat
. makes a note dotted
Lxx length 1-64 of notes 4=1/4 note
MF music in foreground MB music in background
MN music normal, 7/8 of total ML Music legato, 8/8 of total
MS Music staccato, 3/4 of total
Ox set octave 0-7, default = 3 Pxx Pause, range 0-64
Txxx sets tempo 32-255, default=120
> next higher octave < next lower octave
$$ string terminator | measure separator
EXAMPLES:
A#16. A-sharp dotted sixteeth note
Bb8 B-flat eight note
ML|L4|CDEFG>ABC$$ C-scale up in legato quarter notes
--------------------------------------------------------------------------
PLAY.DOC Copyright (c) 1991 by James S. Clark
==========================================================================